home *** CD-ROM | disk | FTP | other *** search
-
- FUNCTION GarmentChk (a : INTEGER) : BOOLEAN;
- { returns TRUE if the item code is valid }
- VAR
- total, i, workdigit : INTEGER;
- BEGIN
- total := 0;
- FOR i := 1 TO 7
- DO BEGIN
- workdigit := a MOD 10;
- { double even digits }
- IF NOT (Odd(i))
- THEN workdigit := workdigit + workdigit;
- { cast nines }
- total := total + ((workdigit MOD 10) + (workdigit DIV 10));
- { get next digit from rightmost side }
- a := a DIV 10;
- { return a Boolean result }
- GarmentChk := ((total MOD 10) = 0)
- END;
-
-